package com.jacky.webflux.commons;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import reactor.core.publisher.Mono;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler({Exception.class})
    public Mono<BasicResp<String>> exceptionHandle(Exception e) {
        return Mono.just(BasicResp.fail(101, e.getMessage()));
    }
}
